package group2.mapper;

import group2.model.ReceiveAddress;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**收获地址
 * @author 薛献军
 * @date 2020/8/25 19:28
 */
@Repository
public interface ReceiveAddressMapper {

    /**
    <!--查询默认地址-->
     */
    int selectDefault(@Param("userId") String userId);

    /**
     * 查询地址信息
     * @param userId
     * @return
     */
    ReceiveAddress selectById(@Param("userId") String userId);

    /**
     * 添加默认地址
     */
     void addAddressYes(@Param("info") ReceiveAddress receiveAddress, @Param("userId") String userId);


    /**
     *添加普通地址
     */
    void addAddressNo(@Param("info") ReceiveAddress receiveAddress, @Param("userId") String userId);

    /**
     * 更新为默认地址
     */
    void updateAddressYes(@Param("addressId") int addressId, @Param("userId") String userId);


    /**
     * 更新为普通地址
     */
    void updateAddressNo(int addressId);

    /**
     * 查看所有地址
     */
     List<ReceiveAddress> selectAllAddress(@Param("userId") String userId);

    /**
     * 删除地址
     */
    void delectAddress(int addressId);

    /*
    更改地址信息
     */
    void updateAddress(ReceiveAddress receiveAddress);

}
